import java.util.Scanner;

public abstract class Main {
    public int a = 5;

    //抽象方法也可以构成重载
    public abstract void method(int a);

    public void method() {

    }

    public static void method1(int a) {
        String str = "he" + new String("llo");
    }

    public void method2() {
        method1(10);
    }

    public static void main(String[] args) {

    }
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();

        String str2 = "";
        String[] str1 = str.split(" ");
        for (int i = str1.length - 1 ; i >= 0; i--) {
            str2 += str1[i];
            if(i > 0 ) {
                str2+=" ";
            }
        }

        System.out.println(str2);
    }
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n+1];

        while(scan.hasNext()) {

            for(int i = 0; i < n; i++ ) {
                array[i] = scan.nextInt();
            }
        }
        int count = 0;
        for(int i = 0; i < n;i++) {
            if(array[i] > array[i+1]) {
                while(i < n  && array[i] >= array[i+1]) {
                    i++;
                }
                count++;
            }else if( array[i] < array[i + 1]) {
                while(i < n && array[i] <= array[i+1]) {
                    i++;
                }
                count++;
            }
        }

        System.out.println(count);
    }
}
